import React ,{useState,useEffect}from 'react'
import { Button, Input,Table } from 'antd'
import axios from 'axios'

export default function Edit() {
  const [a,seta]=useState([])
  const colum =[
    {
      title:"id",
      dataIndex:"id"
    },
    {
      title:"名字",
      dataIndex:"name"
    },
    {
      title:"ip地址",
      dataIndex:"ip"
    },
    {
      title:"操作",
      dataIndex:"edit",
      render:(edit:string)=>{
        <Button type="primary">编辑</Button>
      }
    }

  ]
  useEffect(()=>{
    axios.get("/db/10.json").then(res=>{
     console.log(res.data.xiaolu.pi)
   
     const data = res.data.xiaolu.pi
     seta(data)
          
    })
  })
  return (
    <div>
      <h1>用户登录</h1>
      <br></br>
      {/* 李先文 :<Input style={{width:130}} value={a} /><Button type="primary">编辑</Button> */}
      <br></br>
   
   <Table columns={colum} dataSource={a}></Table>

    </div>
  )
}
